1. Field of the Invention
The present invention relates to a contour detecting apparatus and method, and a storage medium storing a contour detecting program, for detecting a contour (or outline) of a target object included in an image which is taken by an optical (or visual) sensor such as a camera.
2. Description of the Related Art
In order to detect contours of objects by referring to an image captured by an optical sensor such as a camera, a method using active contour models is known. This contour detecting method has a distinctive feature of using contour line models employing dynamic closed curves called “snakes”, thereby detecting contours of objects even if the shapes of the objects temporally change in the images. In the method, an energy function is assigned to the “snake” in consideration of its position and shape, so that the energy decreases to a minimum level when the shape of a target object agrees with that of the “snake”. More specifically, the energy function is defined as the sum of internal energy related to the smoothness of the relevant curve, energy related to a difference (or an error) between the curve and the contour of the target object, energy originated when enforcing external constraint, and the like.
In the method, the position and the shape of the “snake” is dynamically adjusted until a specific minimum solution of the energy function is obtained with respect to the contour of a target object included in an image. Accordingly, it is possible to substitute the minimization of the energy (i.e., an optimization process) for the detection of the contour.
The above-explained outline detecting method employing dynamic contour models has limitations or problems such that the number of objects to be detected must be known or a general contour line must be defined, in advance, in the vicinity of the target object. In order to solve these problems, another kind of contour detecting method has been proposed which can be used even if the number of target objects is unknown and which does not require the definition, in advance, of a general contour of the target object as an initial contour. A paper written by S. Araki, “Real-Time Tracking of Multiple Moving Objects Using Split-and-Merge Contour Models Based on Crossing Detection”, Vol. J80-D-II, No. 11, Proceedings of the IEICE (Institute of Electronics, Information and Communication Engineers), pp. 2940-2948, 1997, and Japanese Unexamined Patent Application, First Publication No. Hei 8-329254 (corresponding to U.S. Pat. No. 5,881,170) disclose examples of the method.
In the contour detecting process of conventional contour detecting methods, it is necessary to increase the number of points for forming the contour (called “nodes”) so as to accurately detect the contour line of the target object. However, the larger the number of nodes, the longer the time necessary for detecting the contour, and accordingly, it is difficult to perform real-time processing. In particular, in a split-determining process for splitting the contour model, determination is performed based on whether two line segments for connecting the nodes contact or intersect each other. In this case, the time necessary for calculating is too long to perform real-time processing.